<template>
  <div>
    <el-table
      :header-cell-style="addHeaderStyle"
      :data="table2"
      style="width: 100%"
      class="tableCol"
    >
      <el-table-column prop="address" label="地区"></el-table-column>
      <el-table-column prop="hunan" label="湖南省"></el-table-column>
      <el-table-column prop="hunan" label="广东省"></el-table-column>
      <el-table-column prop="hunan" label="浙江省"></el-table-column>
      <el-table-column prop="hunan" label="河北省"></el-table-column>
      <el-table-column prop="hunan" label="山西省"></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'table-info',
  props: {
    month: {
      typeof: String
    }
  },
  components: {},
  data () {
    return {
      table2: [
        {
          address: '销售额',
          hunan: '8976'
        },
        {
          address: '销量',
          hunan: '8976'
        },
        {
          address: '利润',
          hunan: '8976'
        }
      ]
    }
  },
  computed: {},
  watch: {},
  created () {
    console.log('子组件month', this.month)
    console.log('子组件1--2', this.month1, this.month2)
  },
  mounted () {},
  methods: {
    // 对表头添加方法
    addHeaderStyle ({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return 'background:rgb(204, 225, 255);'
      }
      console.log(111)
    }
  }
}
</script>

<style lang="less" scoped>
</style>
